import express from "express";
import { useRouter } from "@/api/router";
import { env } from "@/utils/envConfig";
import cors from "cors";

const app = express();
const port = env.PORT;
const origin = env.CORS_ORIGIN;

app.use(cors({ origin }));

useRouter(app);

app.listen(port, () => {
  console.log(`listening on port ${port}`);
});
